package com.huawei.statistics.utils;

import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;

/**
 * Created by 许湛司 on 2017/4/30.
 */
public class PropertyUtils {
    private static final ResourceBundle bundle = ResourceBundle.getBundle("sysConfig");
    /**
     * 获取配置文件参数
     *
     * @param path
     * @return
     */
    public static final Map<Object, Object> getConfigMap(String path) {
        ResourceBundle bundle = ResourceBundle.getBundle(path);
        Set set = bundle.keySet();
        return ConvertUtil.SetToMap(set);
    }

    /**
     * 获取随机码的长度
     *
     * @return 随机码的长度
     */
    public static String getRandCodeLength() {
        return bundle.getString("randCodeLength");
    }

    /**
     * 获取随机码的类型
     *
     * @return 随机码的类型
     */
    public static String getRandCodeType() {
        return bundle.getString("randCodeType");
    }
}
